#!/usr/bin/env python

import time
import toolbar
import datetime

'''String resource

@author Julot <andy.julot@gmail.com>
@since Thursday, February 16, 2012. 05:02 PM'''

class _App(object):
    '''App string resource
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 16, 2012. 06:05 PM'''
    
    name = 'Saki'
    version = '1.0.1.2'
    description = 'SMS Manager'
    longDescription = 'SMS Manager'
    trademarks = 'As I pray, unlimited syntax works'
    copyright = 'Copyright 2012 Julot'
    company = 'Seraphim'
    author = 'Julot'
    authorEmail = 'andy.julot@gmail.com'
    blessing = 'May you do good and not evil.\r\n' \
             + 'May you find forgiveness for yourself and forgive others.\r\n' \
             + 'May you share freely, never taking more than you give.'
    humanVersion = ''
    
    def __init__(self):
        self.histories = {'0.0.0.0': '2012-02-15', '1.0.0.0': '2012-02-20',
                          '1.0.1.0': '2012-03-01', '1.0.1.1': '2012-03-04',
                          self.version: '2012-03-06'}
        
        versions = self.version.split('.')
        stages = ('Alpha', 'Beta', 'Release Candidate', 'Public Release')
        if int(versions[2]) == 3:
            if int(versions[3]) == 0:
                version = '%s.%s' % (versions[0], versions[1])
            else:
                version = '%s.%s Revision %s' % (versions[0], versions[1],
                                                 versions[3])
        else:
            if int(versions[3]) == 0:
                version = '%s.%s %s' % (versions[0], versions[1],
                                        stages[int(versions[2])])
            else:
                version = '%s.%s %s %s' % (versions[0], versions[1],
                                           stages[int(versions[2])],
                                           versions[3])
        self.humanVersion = version
        
        d = self.histories[self.version]
        f = "%Y-%m-%d"
        try:
            self.releaseDate = datetime.datetime(*time.strptime(d, f)[0:5])
        except:
            self.releaseDate = datetime.datetime.now()
        
class _MenuItem(object):
    '''Menu Item string resource
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 16, 2012. 05:25 PM'''
    
    label = ''
    help = ''
    
    def __init__(self, label, help=''):
        self.label = label
        self.help = help

class _Menu(object):
    '''Menu string resource
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 16, 2012. 05:25 PM'''
    
    class _Main(object):
        '''Main string resource
    
        @author Julot <andy.julot@gmail.com>
        @since Friday, February 17, 2012. 07:55 PM'''
        
        file = _MenuItem('&File', 'File')
        message = _MenuItem('&Message', 'Message')
        contacts = _MenuItem('&Contacts', 'Contact')
        help = _MenuItem('&Help', 'Help')
        
    class _File(object):
        '''File string resource
    
        @author Julot <andy.julot@gmail.com>
        @since Friday, February 17, 2012. 07:56 PM'''
    
        quit = _MenuItem('&Quit\tCtrl+Q', 'Close the application')
    
    class _Message(object):
        '''Message string resource
    
        @author Julot <andy.julot@gmail.com>
        @since Saturday, February 18, 2012. 11:54 AM'''
        
        reply = _MenuItem('Reply', 'Reply message')
        archive = _MenuItem('Archive', 'Archive message')
        delete = _MenuItem('Delete', 'Delete message')
        recover = _MenuItem('Recover', 'Recover message')
        read = _MenuItem('Read', 'Read message from modem now')
        s = 'Export messages in inbox to Ms Excel file'
        export = _MenuItem('Export Inbox to Excel', s)
    
    class _Help(object):
        '''Help string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Friday, February 17, 2012. 07:55 PM'''
    
        index = _MenuItem('&Index\tF1', 'Index')
        about = _MenuItem('&About', 'About application')
    
    class _Contact(object):
        '''Contact string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Wednesday, February 22, 2012. 11:37 AM'''
    
        new = _MenuItem('New', 'New contact')
        save = _MenuItem('Save', 'Save contact')
        delete = _MenuItem('Delete', 'Delete contact')
        
    main = _Main()
    help = _Help()
    message = _Message()
    file = _File()
    contact = _Contact()

class _View(object):
    '''View string resource
    
    @author Julot <andy.julot@gmail.com>
    @since Tuesday, February 21, 2012. 02:55 PM'''
    
    class _Main(object):
        '''Main string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Wednesday, February 22, 2012. 11:50 AM'''
        
        messages = 'Messages'
        contacts = 'Contacts'
        groups = 'Groups'
        progress = 'Progress'
    
    class _Message(object):
        '''Message string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Friday, February 24, 2012. 08:49 AM'''

        to = 'Send SMS to'
        status = '%s SMS'
        send = 'Send'
        
    class _Messages(object):
        '''Messages string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Thursday, February 23, 2012. 10:13 AM'''
        
        date = 'Date'
        time = 'Time'
        number = 'Number'
    
    class _Contacts(object):
        '''Contacts string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Wednesday, February 22, 2012. 11:49 AM'''
        
        name = 'Name'
        address = 'Address'
        city = 'City'
        province = 'Province'
        city = 'City'
        phone = 'Phone'
        group = 'Group'
        add = 'Add'
        remove = 'Remove'
        clear = 'Clear'
    
    class _Groups(object):
        '''Groups string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Wednesday, February 29, 2012. 08:23 AM'''
        
        group = 'Group'
        members = 'Members'
        availableContacts = 'Available Contacts'
    
    class _Progress(object):
        '''Progress string resource
        
        @author Julot <andy.julot@gmail.com>
        @since Thursday, March 01, 2012. 10:21 AM'''
        
        number = 'Number'
        message = 'Message'
        
    main = _Main()
    message = _Message()
    messages = _Messages()
    contacts = _Contacts()
    groups = _Groups()
    progress = _Progress()
    
app = _App()
menu = _Menu()
view = _View()